#include <stdio.h>


void file_cpy(const char *src, const char *dest)
{
    FILE *src_file = fopen(src, "r");
    FILE *dest_file = fopen(dest, "w");

    if (src_file == NULL || dest_file == NULL)
    {
        printf("打开文件错误\n");
        return;
    }
    char ch;
    while ((ch = fgetc(src_file)) != EOF)
    {
        fputc(ch, dest_file);
    }

    fclose(src_file);
    fclose(dest_file);
}

int main(int argc, const char *argv[])
{
    if (argc >= 3)
    {
        file_cpy(argv[1], argv[2]);
    }
    else
    {
        printf("参数错误\n");
    }
    return 0;
}